﻿namespace HiMap.MapControls.Tools
{
    using HiMap.MapControls;
    using System;
    using System.Windows.Forms;

    public abstract class ToolClass : ITool
    {
        protected internal MapControl Map;

        protected ToolClass()
        {
        }

        void ITool.OnCreate(MapControl Map)
        {
            this.OnToolCreate(Map);
        }

        void ITool.OnDoubleClick(object sender, EventArgs e)
        {
            this.OnDoubleClick(sender, e);
        }

        void ITool.OnMouseDown(object sender, MouseEventArgs e)
        {
            this.OnMouseDown(sender, e);
        }

        void ITool.OnMouseMove(object sender, MouseEventArgs e)
        {
            this.OnMouseMove(sender, e);
        }

        void ITool.OnMouseUp(object sender, MouseEventArgs e)
        {
            this.OnMouseUp(sender, e);
        }

        void ITool.OnToolUpdated(object sender, EventArgs e)
        {
            this.OnToolUpdated(sender, e);
        }

        protected virtual void OnDoubleClick(object sender, EventArgs e)
        {
        }

        protected virtual void OnMouseDown(object sender, MouseEventArgs e)
        {
        }

        protected virtual void OnMouseMove(object sender, MouseEventArgs e)
        {
        }

        protected virtual void OnMouseUp(object sender, MouseEventArgs e)
        {
        }

        protected virtual void OnToolCreate(MapControl Map)
        {
            this.Map = Map;
        }

        protected virtual void OnToolUpdated(object sender, EventArgs e)
        {
        }
    }
}

